Lab session 10: Simple Vector Machine

Name: Makesh Srinivasan
Registration number: 19BCE1717
Course code: CSE4020
Faculty: Dr. Abdul Quadir
Slot: L31 + L32
Date: 18-October-2021 Monday


Instructions:
perform linear simple vector machine, polynomial vector machine, SVM with kernal and observe the plots using sigmoid functions


Libraries

Create a dataset

Create a dataset with two features and a label. Then, plot the same as a scatter plot to observe the label-classifications

There are two classes, class = 1 shown in blue and class = 0 shown in red


1) Simple Vector Machine (Linear)

Splitting into train and test set

Creating a Linear SVM model

Performance of SVM-linear


2) Simple Vector Machine (Polynomial)

Splitting into train and test set

Plotting

Creating the SVM-polynomial model

Performance measure of SVM polynomial


3) RBF kernel

SVC model

Performance measure


4) Sigmoid kernel

Creating the model

Performance measure


Use a different dataset - car_evaluation

Library

Encoding the label

The dataset has four outcomes. To make the classifications simpler, filter 2 outcomes - unacc and acc

Plotting

Splitting

SVC ploynomial

Performance measure

RBF Kernal

Performance measure

Sigmoid kernel

Performance measure